<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});


//后台
//中间件控制
Route::group(['middleware'=>'login'],function(){
		//主页
		Route::get('/admin/index','Admin\IndexController@index');
		//公告管理
		Route::get('/admin/announce/add','Admin\AnnounceController@add');
		Route::post('/admin/announce/insert','Admin\AnnounceController@insert');
		Route::get('/admin/announce/index','Admin\AnnounceController@index');
		Route::get('/admin/announce/edit/{id}','Admin\AnnounceController@edit');
		Route::post('/admin/announce/updatest','Admin\AnnounceController@updatest');
		Route::post('/admin/announce/updatena','Admin\AnnounceController@updatena');
		Route::post('/admin/announce/updateall','Admin\AnnounceController@updateall');
		Route::get('/admin/announce/delete/{id}','Admin\AnnounceController@delete');

		//管理员管理
		Route::get('/admin/manager/add','Admin\ManagerController@add');
		Route::post('/admin/manager/insert','Admin\ManagerController@insert');
		Route::get('/admin/manager/index','Admin\ManagerController@index');
		Route::get('/admin/manager/edit/{id}','Admin\ManagerController@edit');
		Route::post('/admin/manager/updatest','Admin\ManagerController@updatest');
		Route::post('/admin/manager/updatena','Admin\ManagerController@updatena');
		Route::post('/admin/manager/updateall','Admin\ManagerController@updateall');
		Route::get('/admin/manager/delete/{id}','Admin\ManagerController@delete');

		//用户管理
		Route::get('/admin/user/add','Admin\UserController@add');
		Route::post('/admin/user/insert','Admin\UserController@insert');
		Route::get('/admin/user/index','Admin\UserController@index');
		Route::get('/admin/user/edit/{id}','Admin\UserController@edit');
		Route::post('/admin/user/updatest','Admin\UserController@updatest');
		Route::post('/admin/user/updatena','Admin\UserController@updatena');
		Route::post('/admin/user/updateall','Admin\UserController@updateall');
		Route::get('/admin/user/delete/{id}','Admin\UserController@delete');
		//分类页面
		Route::resource('/admin/cate','Admin\CateController');
		//广告
		Route::controller('admin/ad','Admin\AdController');
		//产品
		Route::controller('/admin/goods','Admin\GoodsController');
		//留言
		Route::controller('/admin/liuyan','Admin\LiuController');
		//友情链接
		Route::controller('/admin/friendlink','Admin\FrendlinkController');
		//登出
		Route::get('/admin/logout','admin\LoginController@logout');
		//后台登入记录
		Route::get('/admin/record/index','admin\RecordController@index');
		//状态
		Route::controller('/admin/stop','admin\StopController');
});



Route::get('/admin/login','Admin\LoginController@index');
//验证码
Route::get('/kit/captcha/{tmp}','KitController@captcha');
Route::post('/admin/dologin','Admin\LoginController@dologin');
//重置密码
Route::get('/admin/forget','Admin\ResetController@forget');
    //发送邮件
Route::post('/admin/reset/send','Admin\ResetController@send');
Route::get('/admin/reset/inputpass/id/{id}/token/{token}','Admin\ResetController@inputpass');
Route::get('/admin/reset/newpass','Admin\ResetController@newpass');
Route::post('/admin/reset/reset','Admin\ResetController@reset');





//前台
//主页

// Route::group(['middleware'=>'stop'],function(){
	//关闭
		
		Route::controller('/home/index','Home\IndexController');
		Route::get('/home/login','Home\LoginController@index');
		Route::get('/home/regist','Home\LoginController@regist');

		Route::post('/home/register/ajaxphone','Home\LoginController@ajaxphone');
		Route::post('/home/register/ajaxpassword1','Home\LoginController@ajaxpassword1');
		Route::post('/home/register/ajaxpassword2','Home\LoginController@ajaxpassword2');
		//注册
		Route::post('/home/register','Home\LoginController@register');
		Route::post('/home/login/login','Home\LoginController@login');
		//忘记密码
		Route::controller('/home/reset','Home\ResetController');
		//简历
		Route::controller('/home/resume','Home\ResumeController');
		//个人中心
		Route::controller('/home/pc','Home\PcController');


		Route::get('/home/pp','Testcontroller@index');
// });
Route::get('/home/stop','Home\StopController@stop');
